const state = {
	activeorder: {
		id: null,
		orderid: null,
		orderstate: false,
		ordertitle: '当前无订单',
		truckload: 0,
		kilometre: 0,
		ordermsg:null,
		storemsg: null,
	},
	startOrder: false
}

const mutations = {
	setAcorder: function (state, params) {
		state.activeorder.id = params.id;
		state.activeorder.orderid = params.orderid;
		state.activeorder.orderstate = params.orderstate;
		state.activeorder.ordertitle = params.ordertitle;
		state.activeorder.truckload = params.truckload;
		state.activeorder.kilometre = params.kilometre;
	},
	cancleOrder: function (state) {
		state.activeorder = {
				orderid: null,
				orderstate: false,
				ordertitle: '当前无订单',
				truckload: 0,
				kilometre: 0
			};
	},
	setAcOrderMsg: function (state, msg) {
		state.activeorder.ordermsg = msg;
	},
	setAcStoreMsg: function (state, msg) {
		state.activeorder.storemsg = msg;
	},
	setStartOrder: function (state, flag) {
		state.startOrder = flag;
	}
}

const getters = {
	getAcOrderMsg: function (state) {
		return state.activeorder.ordermsg;
	},
	getAcStoreMsg: function (state) {
		return state.activeorder.storemsg;
	},
	getOrderId: function (state) {
		return state.activeorder.orderid;
	},
	getAcId: function (state) {
		return state.activeorder.id;
	},
	getSartOrder: function (state) {
		return state.startOrder;
	}
}
const order = {
	state, mutations, getters
}
export default order;